<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>

<div class="container">
    <div class="logo"></div>
    <hr>
    <h3>当前销售单明细表</h3>
    <br>
    <a th:href="@{/sDetails/new}" class="btn btn-primary btn-sm mb-3">新增销售明细</a>
    <br>
    <table class="table table-bordered table-striped">
        <thead class="thead-dark">
        <tr>
            <th>商品ID</th>
            <th>销售数量</th>
            <th>销售总价</th>
            <th>销售价格</th>
            <th>活动</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="aSDetails : ${commoditySD}">
            <td th:text="${aSDetails.many}"></td>
            <td th:text="${aSDetails.quantity}"></td>
            <td th:text="${aSDetails.amount}"></td>
            <td th:text="${aSDetails.price}"></td>
            <td>
                <a th:href="@{/sDetails/update(id=${aSDetails.spId})}" class="btn btn-info btn-sm">更新</a>
                <a
                        th:href="@{/sDetails/delete(id=${aSDetails.spId})}"
                        class="btn btn-danger btn-sm"
                        onclick="if(!(confirm('你确定删除这个商品吗'))) return false"
                >删除</a>
            </td>
        </tr>
        </tbody>
    </table>

</div>


</body>
</html>